package com.szl.yeb.utils;

import com.szl.yeb.entity.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @program: yeb
 * @description: 登录用户信息处理工具
 * @author: szl
 * @create: 2022-08-28 09:40
 **/
public class AdminUtil {
    /**
     * 获取当前登录用户
     * @return
     */
    public static Admin getCurrentAdmin() {
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
